<?php

use Illuminate\Database\Migrations\Migration;
use Illuminate\Database\Schema\Blueprint;
use Illuminate\Support\Facades\Schema;

return new class extends Migration {
    public function up()
    {
        /**
         * 景点 需要根据更新时间 周期性更新 (月) 景区和门票
         */
        Schema::create('scenic_spots', function (Blueprint $table) {
            $table->id();
            $table->string('scenic_id',32)->comment('系统生成,景点id');
            $table->string('scenic_name',64)->comment('景点名称');
            $table->string('star',8)->comment('景点等级, 如: 4A');
            $table->string('rating',3)->comment('景点评分 : 5.0');
            $table->string('province',8)->comment('行政区域 省code');
            $table->string('city',8)->comment('行政区域 市code');
            $table->string('area',8)->comment('行政区域 区code');
            $table->string('address',128)->comment('详细地址');
            $table->string('business_area',128)->default('')->comment('所属商圈 主要高德地图采集');
            $table->string('location',21)->comment('景区经纬度 高德lon,lat');
            $table->string('traffic',128)->default('')->comment('交通信息');
            $table->string('introduction',128)->comment('景区描述');
            $table->string('image',255)->comment('首图');
            $table->tinyInteger('open_type')->comment('景区营业状态 1 营业中 2 歇业中');
            $table->string('open_hours',32)->comment('景区营业时间');
            $table->string('sentence',64)->default('')->comment('一句话描述');
            $table->json('book_notice')->comment('预订须知');

            $table->timestamps();
            $table->index('scenic_name','idx_name');
        });
    }

    public function down()
    {
        Schema::dropIfExists('scenic_spots');
    }
};
